const {
  DataTypes
} = require('sequelize');
module.exports = sequelize => {
  const attributes = {
    roleId: {
      type: DataTypes.BIGINT,
      allowNull: false,
      defaultValue: null,
      primaryKey: true,
      autoIncrement: true,
      comment: "角色编号",
      field: "role_id"
    },
    roleName: {
      type: DataTypes.STRING(100),
      allowNull: false,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "角色名称",
      field: "role_name"
    },
    permission: {
      type: DataTypes.TEXT,
      allowNull: false,
      defaultValue: null,
      primaryKey: false,
      autoIncrement: false,
      comment: "json存储的权限列表",
      field: "permission"
    }
  };
  const options = {
    tableName: "role",
    comment: "",
    indexes: []
  };
  const RoleModel = sequelize.define("roleModel", attributes, options);
  return RoleModel;
};